package com.example.JcGQS.controller;

import com.example.JcGQS.pojo.dto.AuditRelationshipDTO;
import com.example.JcGQS.pojo.dto.AuditRelationshipListDTO;
import com.example.JcGQS.service.AuditRelationshipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 审核人controller
 * @author 末日
 * @date 2023/11/21
 */
@RestController
@RequestMapping("/GQS/auditRelationship")
public class AuditRelationshipController {
    @Autowired
    AuditRelationshipService auditRelationshipService;
    /**
     * 根据采购id,审核人id修改审核状态
     */
    @PostMapping("/update")
    public void auditRelationshipUpdate(@RequestBody AuditRelationshipDTO auditRelationshipDTO, HttpServletRequest request){
        String token = request.getHeader("Authorization");
        auditRelationshipService.auditRelationshipUpdate(auditRelationshipDTO,token);
}
    /**
     * 根据采购id列表,审核人id批量修改审核状态
     */
    @PostMapping("/update/list")
    public void auditRelationshipUpdateList(@RequestBody AuditRelationshipListDTO auditRelationshipListDTO, HttpServletRequest request){
        String token = request.getHeader("Authorization");
        auditRelationshipService.auditRelationshipListUpdate(auditRelationshipListDTO,token);
    }

}
